package fei.yuzhi.com.loveflowers.ui;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import fei.yuzhi.com.loveflowers.factory.FramentFactory;

/**
 * Created by Administrator on 2016/8/9.
 */
public class MainAdapter extends FragmentPagerAdapter {

    int num;
    public MainAdapter(FragmentManager fm, int childCount) {
        super(fm);
        this.num=childCount;
    }

    @Override
    public Fragment getItem(int position) {
        return FramentFactory.createFragment(position);
    }

    @Override
    public int getCount() {
        return num;
    }
}
